﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
using System.IO;
using Billing;

namespace RSAHelper
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btCreateKey_Click(object sender, EventArgs e)
        {
            RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
            valKeyXML.Text = RSA.ToXmlString(true);
        }

        private void btSave_Click(object sender, EventArgs e)
        {
        }

        #region Tab Encrypt\Decrypt

        private void btEncrypt_Click(object sender, EventArgs e)
        {
            valTextToDecrypt.Text = CryptoUtils.RSAEncrypt(valTextToEncrypt.Text);
        }

        private void btDecrypt_Click(object sender, EventArgs e)
        {
            valTextToEncrypt.Text = CryptoUtils.RSADecrypt(valTextToDecrypt.Text);
        }

        #endregion
    }
}
